package com.self;

import java.io.*;

public class BufferWrite {
    public static void main(String[] args) {
        OutputStream os = null;
        OutputStreamWriter osw = null;
        BufferedWriter bw = null;

        try {
            os = new FileOutputStream("/Users/edy/Desktop/file/1.txt",true);
            osw = new OutputStreamWriter(os,"UTF-8");
            bw = new BufferedWriter(osw);
            bw.write("我是中国人");
            bw.write("我是中国人");
            bw.write("我是中国人");
            bw.write("我是中国人");
            bw.write("我是中国人");
            bw.write("我是中国人");
            bw.write("我是中国人");
            bw.write("我是中国人");


            bw.flush();

        } catch (FileNotFoundException | UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {

        }

    }
}
